package com.lagou.rpc.consumer.config;


import com.lagou.rpc.consumer.zookeeperRegister.ZookeeperRegister;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public class Reg implements ApplicationRunner {
    @Autowired
    ZookeeperRegister regster;

    @Override
    public void run(ApplicationArguments args) throws Exception {
            System.out.println("通过实现ApplicationRunner接口，在spring boot项目启动后打印参数");
        List<String> discovery = regster.discovery("/server");
        for( String d :discovery ){
            System.out.println(d);
        }
    }

}
